package com.fh.service.expand;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.fh.dao.DaoSupport;
import com.fh.entity.EventComment;
import com.fh.util.PageData;

@Service("eventCommentService")
public class EventCommentService{

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	
	public void deleteMenuById(String MENU_ID) throws Exception {
		dao.save("EventCommentMapper.deleteMenuById", MENU_ID);
		
	}

	/**
	 * 根据评论对象保存评论
	 * @param eventComment
	 * @throws Exception
	 */
	public int saveEventComment(EventComment eventComment) throws Exception {
		return dao.save("EventCommentMapper.insertEventComment", eventComment);
	}

	/**
	 * 根据应急事件id获取对应的评论(列表)
	 * @param eventId
	 * @return
	 * @throws Exception
	 */
	public List<EventComment> listEventCommentByEventId(Long eventId) throws Exception {
		return (List<EventComment>) dao.findForList("EventCommentMapper.listEventCommentByEventId", eventId);
		
	}
		
	
	/**
	 * 编辑
	 */
	public PageData edit(PageData pd) throws Exception {
		return (PageData)dao.findForObject("EventCommentMapper.updateMenu", pd);
	}
	/**
	 * 保存菜单图标 (顶部菜单)
	 */
	public PageData editicon(PageData pd) throws Exception {
		return (PageData)dao.findForObject("EventCommentMapper.editicon", pd);
	}
	
	/**
	 * 更新子菜单类型菜单
	 */
	public PageData editType(PageData pd) throws Exception {
		return (PageData)dao.findForObject("EventCommentMapper.editType", pd);
	}
}
